cmake_minimum_required(VERSION 3.8)
project(griddatatrans)

# 设置C++标准
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

# 设置输出目录
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)

# 添加所有问题的子目录
add_subdirectory(src)

# 创建输入输出目录结构
file(MAKE_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/q1/input)
file(MAKE_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/q1/output)
file(MAKE_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/q2/input)
file(MAKE_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/q2/output)
file(MAKE_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/q3/input)
file(MAKE_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/q3/output)
file(MAKE_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/final/input)
file(MAKE_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/final/output)

# 复制输入文件到对应目录
file(COPY ${CMAKE_SOURCE_DIR}/input/q1/ DESTINATION ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/q1/input)
file(COPY ${CMAKE_SOURCE_DIR}/input/q2/ DESTINATION ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/q2/input)
file(COPY ${CMAKE_SOURCE_DIR}/input/q3/ DESTINATION ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/q3/input)
file(COPY ${CMAKE_SOURCE_DIR}/input/final/ DESTINATION ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/final/input)